package edu.sctu.fengleilin.month06.day150602.RailWayStation;


import java.util.Calendar;
import java.util.Date;

/**
 * Created by user09 on 2015/6/6.
 */
public class TimeOfStation {
    public static void main(String args[ ]){

        Calendar calendar=Calendar.getInstance();

        calendar.setTime(new Date());

        String 年=String.valueOf(calendar.get(Calendar.YEAR)),
                月=String.valueOf(calendar.get(Calendar.MONTH)+1),
                日=String.valueOf(calendar.get(Calendar.DAY_OF_MONTH)),
                星期=String.valueOf(calendar.get(Calendar.DAY_OF_WEEK)-1);

        int    hour=calendar.get(Calendar.HOUR_OF_DAY),
                minute=calendar.get(Calendar.MINUTE),
                second=calendar.get(Calendar.SECOND);

        System.out.println("现在的时间是：");
        System.out.print(""+年+"年"+月+"月"+日+"日 "+ "星期"+星期);
        System.out.println(" "+hour+"时"+minute+"分"+second+"秒");

        calendar.set(2015,6,4,5,10);
        long timeOne=calendar.getTimeInMillis();
        calendar.set(2015,6,4,5,15);
        long timeTwo=calendar.getTimeInMillis();
        long 相隔天数=(timeTwo-timeOne)/(1000*60);

        System.out.println("两天相隔："+相隔天数+"分钟");
    }

}
